//package com.li.controller.configure;
//
//import com.li.filter.RocketMqConsumerMessageHook;
//import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
//import org.apache.rocketmq.client.producer.DefaultMQProducer;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.stereotype.Component;
//
///**
// * @program: rocketmq_boot
// * @description:
// * @author: li
// * @create: 2023-03-08 10:41
// **/
//@Configuration
//public class MqConfig {
//
////    @Bean
////    public DefaultMQProducer defaultMQProducer() {
////        DefaultMQProducer producer = new DefaultMQProducer();
////        producer.setNamesrvAddr();
////        producer.setSendMsgTimeout(60000);
////        // 设置
////        producer.getDefaultMQProducerImpl().registerSendMessageHook(new RocketMqSendMessageHook());
////    }
//
//    @Bean
//    public DefaultMQPushConsumer defaultMQPushConsumer(@Value("${rocketmq.name-server}") String namesrvAddr) {
//        DefaultMQPushConsumer consumer = new DefaultMQPushConsumer();
//        consumer.setNamesrvAddr(namesrvAddr);
//        consumer.getDefaultMQPushConsumerImpl().registerConsumeMessageHook(new RocketMqConsumerMessageHook());
//        return consumer;
//    }
//}
